<?php
	if ( is_home() ){
		$args=array(
			'showposts'=> esc_attr(get_option('chameleon_homepage_posts')),
			'paged'=>$paged,
			'category__not_in' => get_option('chameleon_exlcats_recent'),
		);
		if (get_option('chameleon_duplicate') == 'false'){
			global $ids;
			$args['post__not_in'] = $ids;
		}
		query_posts($args);
	}
?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

		<?php
			$thumb = '';
			$width = 116;
			$height = 94;
			$classtext = 'post-thumb';
			$titletext = get_the_title();
			$thumbnail = get_thumbnail($width,$height,$classtext,$titletext,$titletext,false,'Entry');
			$thumb = $thumbnail["thumb"];
		?>

     <div class="blog_box">
          <div class="blog_heading">
				<p id='title_in_cata'><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
				<?php //get_template_part('includes/postinfo'); ?>
		  </div><!-- class="blog_heading" -->

		  <div class="news_content">
					<?php 
                     // images
                     if (has_post_thumbnail()) { ?>
                        <a href="<?php the_permalink(); ?>">
                          <?php the_post_thumbnail(array(116,94)); ?>
                        </a>
                        <?php } else { ?>
                          <a href="<?php the_permalink(); ?>">
                            <img  width="311" height="156" src="<?php echo get_bloginfo('template_directory').'/images/no_image.gif';?>" />
                          </a>
                        <?php }  ?>

					<?php if (get_option('chameleon_blog_style') == 'on') the_content(''); else { ?>
						<p><?php truncate_post(600); ?></p>
					<?php }; ?>
				<?php edit_post_link(esc_html__('Chỉnh sửa','Chameleon','')); ?>
                 <a href="<?php the_permalink(); ?>" class="read-more"><?php esc_html_e('Xem thêm','Chameleon'); ?></a>
		  </div><!-- class="news_content" -->

		

	 </div><!-- class="blog_box" -->

	


<?php endwhile; ?>
	                <div class="page-nav" style="float: left;width: 960px;margin-bottom: 14px;"> <!-- clearfix -->
						<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
						else { ?>
							 <?php get_template_part('includes/navigation'); ?>
						<?php } ?>
					</div> <!-- end .entry -->
<?php else : ?>
	<?php get_template_part('includes/no-results'); ?>
<?php endif; if ( is_home() ) wp_reset_query(); ?>


                   